package com.bitejiuyeke.dao;

import com.bitejiuyeke.model.Article;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ArticleMapper {
    int insert(Article row);

    int insertSelective(Article row);

    Article selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Article row);

    int updateByPrimaryKeyWithBLOBs(Article row);

    int updateByPrimaryKey(Article row);

    /**
     * 获取所有帖子的集合
     * @return List<Article>
     */
    List<Article> selectAll ();

    /**
     * 根据版块Id查询帖子列表
     * @param boardId 版块Id
     * @return List<Article>
     */
    List<Article> selectByBoardId (@Param("boardId") Long boardId);

    /**
     * 根据Id查询帖子详情
     * @param id 帖子Id
     * @return Article
     */
    Article selectDetailsById (@Param("id") Long id);
}